using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;

namespace WSBanking.DAO
{
	#region using
	using System.Data;
	using WSBanking.DTO;
	using WSBanking.Helpers;
	#endregion

	/// <summary>
	/// Data access object, which get data of SEBanking_Account table from database
	/// </summary>
	public class SEBanking_AccountDAO : AbstractDAO
	{
		public SEBanking_AccountDAO(string strPath): base(strPath)
		{
		}

        public DataSet SelectByUserIDAndPassword(string userid, string password)
        {
            DataSet ds;
            try
            {
                ds = new DataSet();
                base.sql = "usp_SEBanking_Account_SelectByUserIDAndPassword";
                base.InitializeCommand();
                base.AddParameter("@UserID", SqlDbType.NVarChar, 1000, userid);
                base.AddParameter("@Password", SqlDbType.NVarChar, 1000, password);
                base.FillDataSet(ref ds, "SEBanking_Account");
                return ds;
            }
            catch (System.Exception ex)
            {
                if (ex.InnerException != null)
                {
                    GlobalVariables.Logger.Error(ex.InnerException.Message);
                }
                else
                {
                    GlobalVariables.Logger.Error(ex.Message);
                }
            }
            finally
            {
                base.CleanUpObject();
            }
            return null;
        }
	}
}